import React, { Component } from 'react'
import GridContainer from './Grid.style'
export default class Grid extends Component {
    static defaultProps={
        hasMore:false,
        imgRadius:0.15,
        itemClick:()=>{}
    }
    render() { 
        let Title=this.props.renderTitle;
        return (
            <GridContainer {...this.props}  >
                {/*  column={this.props.column}*/}
                <ul>
                    {
                        this.props.list.map((item, index) => {
                            return (
                                <li key={index}>
                                    <img src={item.img} alt=""
                                    onClick={()=>{
                                        this.props.itemClick()
                                    }} />
                                    <Title item={item}></Title>
                                </li>
                            )
                        }) 
                    }
                   {
                       this.props.hasMore?<li>更多</li>:''
                   }
 
                </ul>
            </GridContainer >
        )
    }
}
